import ToolRequest from '@/base/newToolAxios'
import RequestOption from '@/base/RequestOption'
import { getActToolUrl } from '@/base/constant'
const tr = new ToolRequest()

export default class ProjectDao {
    /**
     * 查询学生个人项目列表
     * @returns
     */
    async SelectProjectByStudentId() {
        const ro = new RequestOption()
        return await tr.get(getActToolUrl(), {
            action: 'SelectProjectByStudentId',
            studentId: '1'
        }, ro)
    }
    /**
     * 查询学生公开项目列表
     * @returns
     */
    async SelectProjectByIsPublic() {
        const ro = new RequestOption()
        return await tr.get(getActToolUrl(), {
            action: 'SelectProjectByIsPublic',
            isPublic: '1'
        }, ro)
    }
    /**
    * 查询查询项目详细信息
    * @returns
    */
    async SelectProjectDetailsByProjectId(projectId: number) {
        const ro = new RequestOption()
        return await tr.get(getActToolUrl(), {
            action: 'SelectProjectDetailsByProjectId',
            projectId: projectId
        }, ro)
    }
    /**
    * 根据信息动态模糊搜索公开项目
    * @returns
    */
    async SelectProjectByInfo(selectvalue: any, input: any) {
        const ro = new RequestOption()
        return await tr.get(getActToolUrl(), {
            action: 'SelectProjectByInfo',
            type: selectvalue,
            keyword: input
        }, ro)
    }


    /**
    * 根据信息动态模糊搜索个人项目
    * @returns
    */
    async SelectStudentProjectByInfo(selectvalue: String, input: string) {
        const ro = new RequestOption()
        return await tr.get(getActToolUrl(), {
            studentId: 1,
            action: 'SelectStudentProjectByInfo',
            type: selectvalue,
            keyword: input
        }, ro)
    }


    async SelectAllUser() {
    const ro = new RequestOption()
    return await tr.get(getActToolUrl(), {
        action: 'SelectAllUser', // 后端API action名称可能需要调整
    }, ro)
}

    async SelectAllTag() {
    const ro = new RequestOption()
    return await tr.get(getActToolUrl(), {
        action: 'SelectAllTag', // 后端API action名称可能需要调整
    }, ro)
}

    async SelectAllAuthor() {
    const ro = new RequestOption()
    return await tr.get(getActToolUrl(), {
        action: 'SelectAllAuthor', // 后端API action名称可能需要调整
    }, ro)
}

}
